import 'package:architecture/os_size.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:study_demo/ui/tool/picture_conduct/picture_conduct_controller.dart';

import '../../../widgets/text_button.dart';

class PictureConductPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetBuilder<PictureConductController>(
        init: PictureConductController(),
        builder: (controller) {
          return Scaffold(
              appBar: AppBar(title: Text('图片处理')),
              body: Container(
                  margin: EdgeInsets.only(top: 20, left: 15),
                  height: windowHeight,
                  child: Wrap(
                      alignment: WrapAlignment.start,
                      crossAxisAlignment: WrapCrossAlignment.start,
                      spacing: 20,
                      runSpacing: 20,
                      children: [
                        _textButton("重命名", onPressed: () {
                          controller.goRenamePage();
                        }),
                        _textButton("格式转换", onPressed: () {
                          controller.goFormatTransformPage();
                        }),
                        // _textButton("大小修改")
                      ])));
        });
  }

  _textButton(String text, {Function? onPressed}) {
    return MyTextButton(
        text: text,
        sideColor: Colors.deepPurple,
        textStyle: TextStyle(color: Colors.deepPurple),
        confirm: onPressed?.call);
  }
}
